package com.example.web.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebFilter("/*")
@Slf4j
@Component
public class DemoFilter implements Filter {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        log.info("被拦截器拦截了");
        chain.doFilter(request, response);
        log.info("又回来了");
    }


    public void init(FilterConfig config) throws ServletException {
    }

    public void destroy() {
    }


}
